import axios from 'axios';

function http (params){
    return axios({...params }).then(res=>res.data).catch(err=>err);
}

async function request (params){
    if(params instanceof Array){
        let res = [];
        for(let index in params){
            res[index] = await http(params[index]);
        }
        return res;
    }else return await http(params);
};

export default request;
